package 面试;

public class 数组分奇偶 {
    public static void main(String[] args) {
        int[] arrs = {1,2,3,22,8,7,4,9,28};
        StringBuilder odds = new StringBuilder();
        StringBuilder events = new StringBuilder();
        for (int arr : arrs) {
            if(arr%2 == 0){
                odds.append(arr + ",");
            }else {
                events.append(arr + ",");
            }
        }
        System.out.println(odds);
        System.out.println(events);
    }
}
